Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement 'LoadingShape' component #1866

Merged
merged 15 commits into from
Oct 4, 2020

Conversation

HellWolf93
Copy link
Collaborator

fix: #1846

Changes proposed in this PR:

@commit-lint
Copy link

commit-lint bot commented Sep 28, 2020

Features

  • implement 'LoadingShape' component (69d5e6f)

Bug Fixes

  • change rect and rouded rect min-height (80b3d0e)
  • add LoadingShape component description (b682fe1)
  • change interactive example input type (40df08b)
  • make SCG icons fill currentColor (056f6d5)
  • some changes in styles (1166ed9)
  • make text color change with the theme (5d31d50)
  • icon (5fc757f)

Documentation

Contributors

@HellWolf93, @TahimiLeonBravo

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

const AvatarIcon = props => {
const { className, style } = props;
return (
<svg className={className} style={style} viewBox="0 0 29 30">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

const ImageIcon = props => {
const { className, style } = props;
return (
<svg viewBox="0 0 37 32" className={className} style={style}>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

height: 100%;
`;

const StyledImageIcon = styled(ImageIcon)`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

`}
`;

const StyledAvatarIcon = styled(AvatarIcon)`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

src/components/LoadingShape/index.js Show resolved Hide resolved
expect(component.prop('shape')).toBe('rounded-rect');
});

it('should render the image icon when variant is "image"', () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

expect(component.find(StyledImageIcon).length).toBe(1);
});

it('should render the user icon when variant is "avatar"', () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

background: ${props => props.palette.background.secondary}
linear-gradient(
90deg,
rgba(226, 228, 233, 0.01) 0%,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use the color calculated on the theme,
on the Table component, we made something like that

        linear-gradient(
            90deg,
            ${props => replaceAlpha(props.palette.background.highlight, 0.01)} 0%,
            ${props => replaceAlpha(props.palette.background.highlight, 0.65)} 50%,
            ${props => replaceAlpha(props.palette.background.highlight, 0.01)} 100%
        );

src/components/LoadingShape/styled/index.js Outdated Show resolved Hide resolved
src/components/LoadingShape/styled/index.js Outdated Show resolved Hide resolved
} else {
el.style.width = '100%';
}
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use an array of dependencies here? with the shape prop, thus it will run only when the shape prop changes

height: 100%;
`;

const StyledImageIcon = attachThemeAttrs(styled(ImageIcon))`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

`}
`;

const StyledAvatarIcon = attachThemeAttrs(styled(AvatarIcon))`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

@codeclimate
Copy link

codeclimate bot commented Oct 4, 2020

Code Climate has analyzed commit 5fc757f and detected 6 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 6

View more on Code Climate.

@TahimiLeonBravo TahimiLeonBravo merged commit 497ff97 into nexxtway:master Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: implement LoadingShape component
3 participants